package top.codehelen.api.config;

import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Classname MPConfig
 * @Description MPConfig
 * @Date 2021/5/12 4:50 下午
 * @Created by helen
 */
@Configuration
public class MPConfig {
    @Bean
    public MapperScannerConfigurer mapperScannerConfigurer(){
        MapperScannerConfigurer scannerConfigurer = new MapperScannerConfigurer();
        //可以通过环境变量获取你的mapper路径,这样mapper扫描可以通过配置文件配置了
        scannerConfigurer.setBasePackage("top.codehelen.mapper");
        return scannerConfigurer;
    }
}
